Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrTheCongNo_KhachHang_chitiet
    Private trang As Integer = 1
    Private thangnam As Date
    Private tungay As Date
    Private denngay As Date
    Private tenkh As String
    Private sqlQuery As String
    Private customerReport As ReportDocument

    Private Sub FrmCrTheCongNo_KhachHang_chitiet_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        sqlQuery = " SELECT t1.* FROM tbl_dot_thecongno_khachhang_chitiet as t1 ORDER BY t1.ngay_chungtu,t1.id "
        Dim reportPath = Application.StartupPath & "\" & "crTheCongNo_KhachHang_chitiet.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("TThangnam", thangnam)
        customerReport.SetParameterValue("TTungay", tungay)
        customerReport.SetParameterValue("TDenngay", denngay)
        customerReport.SetParameterValue("TTenkh", tenkh)
        customerReport.SetParameterValue("trang", trang)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub
    Public Sub setTrang(ByVal s As Integer)
        trang = s
    End Sub
    Public Sub setThangnam(ByVal s As Date)
        thangnam = s
    End Sub
    Public Sub setTungay(ByVal s As Date)
        tungay = s
    End Sub
    Public Sub setDenngay(ByVal s As Date)
        denngay = s
    End Sub

    Public Sub setTenkh(ByVal s As String)
        tenkh = s
    End Sub

End Class
